Login dark
author: 零贰
title: 给WordPress添加Mini Flash播放器
date: 2011-10-18 02:13:36
category: [学习笔记]
tags: [Wordpress]

<p>转载自【自力博客】:
</p> <p>1、下载flash播放器: 然后上传到 wp-content/theme/主题目录/</p> <p>2、在Wordpress 在用主题的 functions.php 中间位置添加如下函数: <!--more-->

<p>/*添加 flash player / function myplayer($atts, $content=null){ extract(shortcode_atts(array("auto"=>'no',"loop"=>'no'),$atts)); return '&lt;embed src="'.get_bloginfo("template_url").'/player.swf?soundFile='.$content.'&bg=0xeeeeee&leftbg=0x357dce&lefticon=0xFFFFFF&rightbg=0xf06a51&rightbghover=0xaf2910&righticon=0xFFFFFF&righticonhover=0xffffff&text=0x666666&slider=0x666666&track=0xFFFFFF&border=0x666666&loader=0x9FFFB8&loop='.$loop.'&amp;autostart='.$auto.'" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" width="290" height="30">'; } add_shortcode('music','myplayer');</p>
<pre>代码调用:[music]音乐绝对地址[/music] </pre> <p> </p> <p>效果预览:</p> <p>[music]http://www.cool02.com/0ther/错的都是我.mp3[/music]</p>